package Interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import model.Category;

import java.util.List;

/**
 * Created by Properly on 2018/7/1.
 */
public class NavInterceptor implements Interceptor {
    @Override
    public void intercept(Invocation invocation) {
        List<Category> categories = Category.dao.find("SELECT * FROM t_category");
        invocation.getController().setAttr("categories", categories);
        invocation.invoke();
    }
}
